--- vncserver.orig	2009-02-12 06:27:18.000000000 +0200
+++ vncserver	2021-03-27 08:35:57.331183132 -0400
@@ -48,10 +48,12 @@
 
 $defaultXStartup
     = ("#!/bin/sh\n\n".
-       "xrdb \$HOME/.Xresources\n".
-       "xsetroot -solid grey\n".
-       "xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".
-       "twm &\n");
+       "#xrdb \$HOME/.Xresources\n".
+       "#xsetroot -solid grey\n".
+       "#xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".
+       "#twm &\n".
+       "# Start X session using xinitrc \n".
+       "/etc/X11/xinit/xinitrc &\n");
 
 $xauthorityFile = "$ENV{XAUTHORITY}";
 
@@ -161,7 +163,9 @@
 
 $cmd = "Xvnc :$displayNumber";
 $cmd .= " -desktop " . &quotedString($desktopName);
-$cmd .= " -httpd $vncClasses";
+if ( -d $vncCllasses ) {
+   $cmd .= " -httpd $vncClasses";
+}
 $cmd .= " -auth $xauthorityFile";
 $cmd .= " -geometry $geometry" if ($geometry);
 $cmd .= " -depth $depth" if ($depth);
